﻿using System;
using System.Collections.Generic;

using Microsoft.Xna.Framework;

using FarseerPhysics.Factories;
using FarseerPhysics.Common;

using ZoeEngine.Components.Physics;

namespace ZoeEngine.Framework.Collision
{
	public abstract class PhysShape
	{
        protected PhysBodyComponent _parent = null;
        protected float _density = 1.0f;
        protected float _friction = 0.1f;
        protected float _restitution = 0.1f;

        public virtual void AttachShape(PhysBodyComponent parent) { }

        public float Density
        {
            get
            {
                return _density;
            }
            set
            {
                _density = value;
                if (_parent != null)
                {
                    _parent.BuildCollisionShapes();
                }
            }
        }
        public float Friction
        {
            get
            {
                return _friction;
            }
            set
            {
                _friction = value;
                if (_parent != null)
                {
                    _parent.BuildCollisionShapes();
                }
            }
        }
        public float Restitution
        {
            get
            {
                return _restitution;
            }
            set
            {
                _restitution = value;
                if (_parent != null)
                {
                    _parent.BuildCollisionShapes();
                }
            }
        }
	}
}
